from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from frame_structure import Frame, Ontology, BaseContainer, SingleContainer, SetContainer, ListContainer

class VisualStructure:
    def __init__(self):
        self.nodes: dict[int, str] = {}
        self.edges: dict[tuple[int, int], str] = {}
        self.str: str = None

    def append_node(self, index: int, node_str: str):
        self.nodes[index] = node_str

    def to_string(self):
        if isinstance(self.str, str):
            return self.str
        else:
            raise Exception(f'{self.str} can not be converted to string')